#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QList>
#include <QVariant>
#include "search.h"
#include "searchthread.h"
#include "indexthread.h"
#include "showindexdialog.h"

namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();

private slots:
    void on_search_button_clicked();

    void on_again_search_button_clicked();

    void receive_file_msg(int already, int count, QString file_name, QString msg);

    void receive_error(QString error_type, QString error_info, QString sql);

    void receive_list(QVariant v);

    void receive_index_finished();

    void receive_db_name(QString db_name);

    void on_show_index_clicked();

    void on_create_index_clicked();

    void on_fold_line_edit_textChanged(const QString &arg1);

private:
    Ui::MainWindow *ui;
    QList<Searched> searched;
    IndexThread *index_thread;
    SearchThread *search_thread;
    ShowIndexDialog *show_dlg;
    bool add_index;
};

#endif // MAINWINDOW_H
